<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ESP32 HTTPS Server: /home/frank/Projekte/esp32/https_server/esp32_https_server/src/ResourceResolver.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ESP32 HTTPS Server
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('ResourceResolver_8hpp_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">ResourceResolver.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef SRC_RESOURCERESOLVER_HPP_</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define SRC_RESOURCERESOLVER_HPP_</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">// Arduino declares it&#39;s own min max, incompatible with the stl...</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#undef min</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#undef max</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &lt;algorithm&gt;</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &quot;HTTPNode.hpp&quot;</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &quot;WebsocketNode.hpp&quot;</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &quot;ResourceNode.hpp&quot;</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &quot;ResolvedResource.hpp&quot;</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &quot;HTTPMiddlewareFunction.hpp&quot;</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacehttpsserver.html">httpsserver</a> {</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="classhttpsserver_1_1ResourceResolver.html">   22</a></span>&#160;<span class="keyword">class </span><a class="code" href="classhttpsserver_1_1ResourceResolver.html">ResourceResolver</a> {</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;  <a class="code" href="classhttpsserver_1_1ResourceResolver.html">ResourceResolver</a>();</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;  ~<a class="code" href="classhttpsserver_1_1ResourceResolver.html">ResourceResolver</a>();</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhttpsserver_1_1ResourceResolver.html#af7af69fbd2bd59abc82cd57129f0d4b1">registerNode</a>(<a class="code" href="classhttpsserver_1_1HTTPNode.html">HTTPNode</a> *node);</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhttpsserver_1_1ResourceResolver.html#a69687da9423b26b2cea4520cfdd89764">unregisterNode</a>(<a class="code" href="classhttpsserver_1_1HTTPNode.html">HTTPNode</a> *node);</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;  <span class="keywordtype">void</span> setDefaultNode(<a class="code" href="classhttpsserver_1_1HTTPNode.html">HTTPNode</a> *node);</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;  <span class="keywordtype">void</span> resolveNode(<span class="keyword">const</span> std::string &amp;method, <span class="keyword">const</span> std::string &amp;url, <a class="code" href="classhttpsserver_1_1ResolvedResource.html">ResolvedResource</a> &amp;resolvedResource, <a class="code" href="namespacehttpsserver.html#a2dcb10ebf7a4b0511b3ca52d4af865ff">HTTPNodeType</a> nodeType);</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhttpsserver_1_1ResourceResolver.html#a1f931501aebe03f04b84fb8bf074c4f3">addMiddleware</a>(<span class="keyword">const</span> <a class="code" href="namespacehttpsserver.html#a52016b2f3eb2452288ddae01a9f5633b">HTTPSMiddlewareFunction</a> * mwFunction);</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhttpsserver_1_1ResourceResolver.html#ae28a9f9e98343d5be423d60b8ad7ce56">removeMiddleware</a>(<span class="keyword">const</span> <a class="code" href="namespacehttpsserver.html#a52016b2f3eb2452288ddae01a9f5633b">HTTPSMiddlewareFunction</a> * mwFunction);</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;  <span class="keyword">const</span> std::vector&lt;HTTPSMiddlewareFunction*&gt; <a class="code" href="classhttpsserver_1_1ResourceResolver.html#ad49926626868ac54d013090883686d8f">getMiddleware</a>();</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;  <span class="comment">// This vector holds all nodes (with callbacks) that are registered</span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;  std::vector&lt;HTTPNode*&gt; * _nodes;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;  <a class="code" href="classhttpsserver_1_1HTTPNode.html">HTTPNode</a> * _defaultNode;</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;  <span class="comment">// Middleware functions, if any are registered. Will be called in order of the vector.</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;  std::vector&lt;const HTTPSMiddlewareFunction*&gt; _middleware;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;};</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;} <span class="comment">/* namespace httpsserver */</span></div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* SRC_RESOURCERESOLVER_HPP_ */</span><span class="preprocessor"></span></div><div class="ttc" id="classhttpsserver_1_1HTTPNode_html"><div class="ttname"><a href="classhttpsserver_1_1HTTPNode.html">httpsserver::HTTPNode</a></div><div class="ttdoc">Base class for a URL/route-handler in the server. </div><div class="ttdef"><b>Definition:</b> HTTPNode.hpp:26</div></div>
<div class="ttc" id="classhttpsserver_1_1ResourceResolver_html"><div class="ttname"><a href="classhttpsserver_1_1ResourceResolver.html">httpsserver::ResourceResolver</a></div><div class="ttdoc">This class is used internally to resolve a string URL to the corresponding HTTPNode. </div><div class="ttdef"><b>Definition:</b> ResourceResolver.hpp:22</div></div>
<div class="ttc" id="namespacehttpsserver_html_a2dcb10ebf7a4b0511b3ca52d4af865ff"><div class="ttname"><a href="namespacehttpsserver.html#a2dcb10ebf7a4b0511b3ca52d4af865ff">httpsserver::HTTPNodeType</a></div><div class="ttdeci">HTTPNodeType</div><div class="ttdef"><b>Definition:</b> HTTPNode.hpp:13</div></div>
<div class="ttc" id="classhttpsserver_1_1ResourceResolver_html_a69687da9423b26b2cea4520cfdd89764"><div class="ttname"><a href="classhttpsserver_1_1ResourceResolver.html#a69687da9423b26b2cea4520cfdd89764">httpsserver::ResourceResolver::unregisterNode</a></div><div class="ttdeci">void unregisterNode(HTTPNode *node)</div><div class="ttdef"><b>Definition:</b> ResourceResolver.cpp:24</div></div>
<div class="ttc" id="classhttpsserver_1_1ResourceResolver_html_af7af69fbd2bd59abc82cd57129f0d4b1"><div class="ttname"><a href="classhttpsserver_1_1ResourceResolver.html#af7af69fbd2bd59abc82cd57129f0d4b1">httpsserver::ResourceResolver::registerNode</a></div><div class="ttdeci">void registerNode(HTTPNode *node)</div><div class="ttdef"><b>Definition:</b> ResourceResolver.cpp:17</div></div>
<div class="ttc" id="classhttpsserver_1_1ResourceResolver_html_a1f931501aebe03f04b84fb8bf074c4f3"><div class="ttname"><a href="classhttpsserver_1_1ResourceResolver.html#a1f931501aebe03f04b84fb8bf074c4f3">httpsserver::ResourceResolver::addMiddleware</a></div><div class="ttdeci">void addMiddleware(const HTTPSMiddlewareFunction *mwFunction)</div><div class="ttdef"><b>Definition:</b> ResourceResolver.cpp:163</div></div>
<div class="ttc" id="classhttpsserver_1_1ResourceResolver_html_ad49926626868ac54d013090883686d8f"><div class="ttname"><a href="classhttpsserver_1_1ResourceResolver.html#ad49926626868ac54d013090883686d8f">httpsserver::ResourceResolver::getMiddleware</a></div><div class="ttdeci">const std::vector&lt; HTTPSMiddlewareFunction * &gt; getMiddleware()</div><div class="ttdef"><b>Definition:</b> ResourceResolver.cpp:171</div></div>
<div class="ttc" id="namespacehttpsserver_html"><div class="ttname"><a href="namespacehttpsserver.html">httpsserver</a></div><div class="ttdef"><b>Definition:</b> ConnectionContext.cpp:3</div></div>
<div class="ttc" id="classhttpsserver_1_1ResolvedResource_html"><div class="ttname"><a href="classhttpsserver_1_1ResolvedResource.html">httpsserver::ResolvedResource</a></div><div class="ttdoc">This class represents a resolved resource, meaning the result of mapping a string URL to an HTTPNode...</div><div class="ttdef"><b>Definition:</b> ResolvedResource.hpp:12</div></div>
<div class="ttc" id="classhttpsserver_1_1ResourceResolver_html_ae28a9f9e98343d5be423d60b8ad7ce56"><div class="ttname"><a href="classhttpsserver_1_1ResourceResolver.html#ae28a9f9e98343d5be423d60b8ad7ce56">httpsserver::ResourceResolver::removeMiddleware</a></div><div class="ttdeci">void removeMiddleware(const HTTPSMiddlewareFunction *mwFunction)</div><div class="ttdef"><b>Definition:</b> ResourceResolver.cpp:167</div></div>
<div class="ttc" id="namespacehttpsserver_html_a52016b2f3eb2452288ddae01a9f5633b"><div class="ttname"><a href="namespacehttpsserver.html#a52016b2f3eb2452288ddae01a9f5633b">httpsserver::HTTPSMiddlewareFunction</a></div><div class="ttdeci">void() HTTPSMiddlewareFunction(HTTPRequest *req, HTTPResponse *res, std::function&lt; void()&gt; next)</div><div class="ttdoc">A middleware function that can be registered at the server. </div><div class="ttdef"><b>Definition:</b> HTTPMiddlewareFunction.hpp:24</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><b>ResourceResolver.hpp</b></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
